<?php

class Zend_View_Helper_Dish extends Zend_View_Helper_Abstract
{

	
	public function dish(Model_Dish $dish, $type)
	{
		if ($type=="mini"){
			return $this->miniDish($dish);
		}
		else if ($type=="detail"){
			return $this->detailDish($dish);
		}
		
		else if ($type=="managerMini"){
			return $this->managerMini($dish);
		}
		
	}
	
	public function miniDish(Model_Dish $dih){
		$name= $dih->getName();
		$image= $dih->getImage();
		$id= $dih->getId();
		$category= $dih->getCategory()->getName();
		$categoryId= $dih->getCategory()->getId();
	
		$description=$dih->getDescription();
		$link= '/dish/detail/';
		$link=$link.'?id='.$id; 
		
		$result=
		'<div class="DishMini selected">
			<img class="mini-img" src="'.$image.'"></img>
			<div class="DishInfo">
				<span class="DishTitle-small"><a href="'.$link.'">'.$name.'</a></span> <br />
				<span class="DishDescription-small">'.$description.'</span> <br />	
			</div>
		</div>';
		
		return $result;
	}
	
	public function managerMini(Model_Dish $dih){
		$name= $dih->getName();
		$image= $dih->getImage();
		$id= $dih->getId();
		$category= $dih->getCategory()->getName();
		$categoryId= $dih->getCategory()->getId();
	
		
		$link= '/dish/detail/';
		$link=$link.'?id='.$id;
	
		$result=
		'   
			<div class="DishMini selected">
			<img class="managerDish-img" src="'.$image.'"></img>
			<div class="DishInfo">
				
				<span class="DishTitle-small"><a href="'.$link.'">'.$name.'</a></span>
				<span class="manager-edit">
						<a  href="/dish/edit?id='.$id.'">Edit</a>&nbsp;
						
				<a href="/dish/remove?id='.$id.'">Remove</a></span> 
			
			</div>
		</div>';
	
		return $result;
	}
	
	public function detailDish(Model_Dish $dih){
		$name= $dih->getName();
		$image= $dih->getImage();
		$id= $dih->getId();
		$category= $dih->getCategory()->getName();
		$categoryId= $dih->getCategory()->getId();
	
		$description=$dih->getDescription();
		$link= '/dish/detail/';
		$link=$link.'?id='.$id; 
		
		$result=
		'
			<div class="dish">
				<img src="'.$image.'"></img>
				<div class="info">
					<div class="dish-title">'.$name.'</div> <br />	
					<hr class="dish-bottom-line" />
					<div class="dish-category">'.$category.'</div> <br />
					<div class="dish-description">'.$description.'</div> <br />	
				</div>
			</div>	
		';
		return $result;
	}
	
	
	
	
	

}
